package org.example.design.adapter.twoway;

/**
 * @author huangshen
 * @version 0
 * @description TwoWayAdapter
 * @since 2022/2/3 0:41
 */
public class TwoWayAdapter implements TwoWayAdaptee,TwoWayTarget {

    private TwoWayTarget target;
    private TwoWayAdaptee adaptee;

    public TwoWayAdapter(TwoWayTarget target) {
        this.target=target;
    }

    public TwoWayAdapter(TwoWayAdaptee adaptee) {
        this.adaptee=adaptee;
    }

    @Override
    public void request() {
        adaptee.specificRequest();
    }

    @Override
    public void specificRequest() {
        target.request();
    }
}
